package com.ztl.mymqtt.utils;

import java.text.SimpleDateFormat;
import java.util.TimeZone;

public class Utils4Date {

    public  static  String getYMD(String pattern)
    {
        SimpleDateFormat simpleDateFormat=new SimpleDateFormat(pattern);
        TimeZone timeZone=TimeZone.getTimeZone("Asia/Shanghai");
        simpleDateFormat.setTimeZone(timeZone);

        return  simpleDateFormat.format(System.currentTimeMillis());
    }
}
